Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix workflow dispatch - add yq compatibility switch and fix job creation #15

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

brablc
Copy link
Contributor

@brablc brablc commented Nov 18, 2024

The version of yq 4.x provided by homebrew on macOS when run without parameters does not convert Yaml to JSON as does the version 3.x on Ubuntu (it provides Yaml output instead). As gh-actions expects JSON, we need to force conversion. In previous attempt in #14 -o=json was used, but this is not supported by 3.x versions.

But it looks like all versions support -j with the same meaning.

However, on my systems (macOS, Linux) there is even earlier problem - execution of the job. So I provide a fix for this too.

Copy link
Owner

@topaxi topaxi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-j means --join-output on my version of yq, anyway, that shouldn't hurt in this case and should be fine.

@topaxi
Copy link
Owner

topaxi commented Nov 18, 2024

Thank you!

@topaxi topaxi merged commit 6e16463 into topaxi:main Nov 18, 2024
2 checks passed
@brablc
Copy link
Contributor Author

brablc commented Nov 18, 2024

-j means --join-output on my version of yq, anyway, that shouldn't hurt in this case and should be fine.

This help actually comes from jq command (and I believe yq would not pass those options down to jq). The options -j and --tojson are marked as deprecated https://github.com/mikefarah/yq/blob/80310eaaaccb16c8ba6efe8c017c5eb623a4bf65/cmd/root.go#L103 , and produce a warning on stderr, but both work. So I now believe it is a good fix for time being.

@topaxi
Copy link
Owner

topaxi commented Nov 18, 2024

Ah yes, thanks, perfect :)

@brablc
Copy link
Contributor Author

brablc commented Nov 18, 2024

This starts to get embarassing for me ;-) It does not work with yq 4.* on macOS. I have another patch, but I will have to test it on Linux/Ubuntu tomorrow.

@topaxi
Copy link
Owner

topaxi commented Nov 19, 2024

No worries, differences between operating systems and external tooling with different versions can be a headache 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants